import { ApiProperty, Type } from '@midwayjs/swagger'

/**
 * 分页结果
 */
export function PageVO<T extends Type>(ListItemCls: T) {
  class VO {
    @ApiProperty({ description: '页码' })
    pageNum: number

    @ApiProperty({ description: '页长' })
    pageSize: number

    @ApiProperty({ description: '总数' })
    total: number

    @ApiProperty({ description: '列表', type: [ListItemCls] })
    list: T
  }

  return VO
}
